"! Standard 32bit integer "
Number subclass: Integer [
<category: 'Library-Numbers'>
"! Info:
Return this object multiplied by arg

Examples:
"
* arg [
<integerMult self arg>
(arg isMemberOf: Integer) ifFalse: [^ self * arg asInteger].
self primitiveFailed
]

"! Info:
Return the sum of this object and arg

Examples:
"
+ arg [
<integerAdd self arg>
(arg isMemberOf: Integer) ifFalse: [^ self + arg asInteger].
self primitiveFailed
]

"! Info:
Return this arg subtracted from object

Examples:
"
- arg [
<integerSub self arg>
(arg isMemberOf: Integer) ifFalse: [^ self - arg asInteger].
self primitiveFailed
]

"! Info:
Return true if this object is smaller than arg

Examples:
"
< arg [
<integerLess self arg>
(arg isMemberOf: Integer) ifFalse: [^ self < arg asInteger].
self primitiveFailed
]

"! Info:
Return true if this object is equal to arg

Examples:
"
= arg [
<integerEqual self arg>
(arg isMemberOf: Integer) ifFalse: [^ self = arg asInteger].
self primitiveFailed
]

"! Info:
Returns self

Examples:
"
asInteger [
^ self
]

"! Info:
Try to fit into a SmallInt

Examples:
"
asSmallInt [
<smallintFit self>.
self overflow
]

"! Info:
Return the quotient of this object with arg

Examples:
"
/ arg [
<integerDiv self arg>
(arg isMemberOf: Integer) ifFalse: [^ self / arg asInteger].
(0 = arg) ifTrue: [^ self divzero].
self primitiveFailed
]

"! Info:
Return the remainder of this object divided by arg

Examples:
"
rem: arg [
<integerMod self arg>
(arg isMemberOf: Integer) ifFalse: [^ self rem: arg asInteger].
(0 = arg) ifTrue: [^ self divzero].
self primitiveFailed
]

"! Info:
Truncate to a SmallInt

Examples:
"
truncSmallInt [
<smallintTrunk self>.
self primitiveFailed
]

]

"! Class methods for Integer "
MetaNumber subclass: MetaInteger [
<category: 'Library-Numbers'>
"! Info:
Create a new Integer from a SmallInt, low

Examples:
"
new: low [
|small|
<smallintAlloc low>
small := low asSmallInt.
<smallintAlloc small>
self primitiveFailed
]

]

